package com.jvm.binary.initialize.dynamic_static;

import java.io.Serializable;

/**
 * OverLoadDemo..
 *
 * @author Lizhong
 * @date 2019/3/15
 */
public class OverLoadDemo {
    public void hello(Object obj) {
        System.out.println("my is object");
    }

    public void hello(char obj) {
        System.out.println("my is char");
    }

    public void hello(Character obj) {
        System.out.println("my is Character");
    }

    public void hello(int obj) {
        System.out.println("my is int ");
    }

    public void hello(long obj) {
        System.out.println("my is long ");
    }

    public void hello(double obj) {
        System.out.println("my is double ");
    }

    /** // not overload method
     public void hello(Integer obj) {
     System.out.println("my is Integer ");
     }*/

    public void hello(Serializable obj) {
        System.out.println("my is Serializable ");
    }


    public void hello(char... obj) {
        System.out.println("my is char... ");
    }

    /**分割线======================================================*/
    public void method01(Long[] longs) {
        //TODO 2019/7/12 14:00
    }

    public void method01(char[] chars) {
        //TODO 2019/7/12 14:03
    }

    public void method01(Object o) {
        //TODO 2019/7/12 14:01
    }


    /**
     * 可变参数char 不会转成int 可变参数优先级zui最低，Integer 类型不能重载char
     @param args
     */
    public static void main(String[] args) {
        OverLoadDemo overLoadDemo = new OverLoadDemo();
        overLoadDemo.hello('c');
        // 调用出错
        // overLoadDemo.method01(null);
    }
    /**Out~
     * // my is char
     * // my is int
     * // my is long
     * // my is double
     * // my is Character
     * // my is Serializable
     * // my is object
     * // my is char...
     */
}
